package com.magic233.utils;

import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;

/**
 * ClassName: JasyptUtil
 * Description:
 * date: 2021/10/20 22:27
 * author: zouyuan
 */
public class JasyptUtil {
    public static void main(String[] args) {
        StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
        SimpleStringPBEConfig config = new SimpleStringPBEConfig();
        // 设置密钥
        config.setPassword("");
        // 设置加密方法
        config.setAlgorithm("PBEWithMD5AndDES");
        encryptor.setConfig(config);
        // 加密内容
        String encryptStr = encryptor.encrypt("");
        System.out.println(encryptStr);
        System.out.println(encryptor.decrypt(encryptStr));
    }
}
